import java.util.regex.*;

public class Programa14{
	public static void main(String [] a){
		Pattern p = Pattern.compile("ab[\\w]?");
		Matcher m = p.matcher("xxab_zzab23qqqabd");
		boolean b = false;
		String s = "";
		while(b = m.find()){
			System.out.println(" " + m.group());
		}
	}
}